/**
 * 组装模块并导出 store
 */

import Vue from 'vue'
import Vuex from 'vuex'
import * as getters from './getters'
import * as actions from './actions'
import * as mutations from './mutations'
import storage from '@/storage'

Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production'

const state = {
  loadingCount: 0,
  uid: storage.get('UID') || '',
  authToken: storage.get('AUTH_TOKEN') || ''
}

const store = new Vuex.Store({
  actions,
  getters,
  modules: {
  },
  mutations,
  state,
  strict: debug
})

export default store
